import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;


public class Leetcode217 {
    public static void main(String[] args) {
        System.out.println(containsDuplicate(new int[]{1, 2, 1000, 10000}));
    }

    public static boolean containsDuplicate(int[] nums) {
        int n = nums.length;
        boolean[] count = new boolean[n];
        for (int num : nums) {
            int hash = Integer.hashCode(num) % n;
            if (count[hash]) {
                return true;
            } else {
                count[hash] = true;
            }
        }

        return false;
    }
}
